<?php

class Application_Model_ProductBuy
{
	protected $_product_buy_id;
	protected $_member_id;
    protected $_title;
    protected $_description;
    protected $_price;
    protected $_quantity;
    protected $_image;
    protected $_sub_image1;
    protected $_sub_image2;
    protected $_country;
    protected $_category;
    protected $_new;
    protected $_day;
    protected $_trade;
    protected $_deposit;
    protected $_delivery;
    protected $_paypal;
    protected $_bank;
    protected $_cheque;
    protected $_others;
    protected $_status;
    protected $_winner;
    protected $_creation_time;
    
    protected $_username;
    
    /*** product_buy_bid ***/
    protected $_final_price;

    public function __construct(array $options = null)
    {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }

    public function __set($name, $value)
    {
        $method = 'set' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid product_buy property');
        }
        $this->$method($value);
    }

    public function __get($name)
    {
        $method = 'get' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid product_buy property');
        }
        return $this->$method();
    }

    public function setOptions(array $options)
    {
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
        return $this;
    }

    public function setProduct_buy_id($id)
    {
        $this->_product_buy_id = (string) $id;
        return $this;
    }

    public function getProduct_buy_id()
    {
        return $this->_product_buy_id;
    }
    
	public function setMember_id($id)
    {
        $this->_member_id = (string) $id;
        return $this;
    }

    public function getMember_id()
    {
        return $this->_member_id;
    }
    
    public function setTitle($text)
    {
        $this->_title = (string) $text;
        return $this;
    }

    public function getTitle()
    {
        return $this->_title;
    }
    
	public function setDescription($text)
    {
        $this->_description = (string) $text;
        return $this;
    }

    public function getDescription()
    {
        return $this->_description;
    }
    
	public function setPrice($price)
    {
        $this->_price = (int) $price;
        return $this;
    }

    public function getPrice()
    {
        return $this->_price;
    }
    
	public function setQuantity($quantity)
    {
        $this->_quantity = (int) $quantity;
        return $this;
    }

    public function getQuantity()
    {
        return $this->_quantity;
    }
    
	public function setImage($text)
    {
        $this->_image = (string) $text;
        return $this;
    }

    public function getImage()
    {
        return $this->_image;
    }
    
	public function setSub_image1($text)
    {
        $this->_sub_image1 = (string) $text;
        return $this;
    }

    public function getSub_image1()
    {
        return $this->_sub_image1;
    }

	public function setSub_image2($text)
    {
        $this->_sub_image2 = (string) $text;
        return $this;
    }

    public function getSub_image2()
    {
        return $this->_sub_image2;
    }
    
    public function setCountry($text)
    {
        $this->_country = (string) $text;
        return $this;
    }

    public function getCountry()
    {
        return $this->_country;
    }
    
	public function setCategory($category)
    {
        $this->_category = (string) $category;
        return $this;
    }

    public function getCategory()
    {
        return $this->_category;
    }
    
    public function setNew($new)
    {
        $this->_new = (int) $new;
        return $this;
    }

    public function getNew()
    {
        return $this->_new;
    }
    
	public function setDay($day)
    {
        $this->_day = (int) $day;
        return $this;
    }

    public function getDay()
    {
        return $this->_day;
    }
    
	public function setTrade($text)
    {
        $this->_trade = (string) $text;
        return $this;
    }

    public function getTrade()
    {
        return $this->_trade;
    }
    
	public function setDeposit($deposit)
    {
        $this->_deposit = (int) $deposit;
        return $this;
    }

    public function getDeposit()
    {
        return $this->_deposit;
    }
    
	public function setDelivery($text)
    {
        $this->_delivery = (string) $text;
        return $this;
    }

    public function getDelivery()
    {
        return $this->_delivery;
    }
    
	public function setPaypal($text)
    {
        $this->_paypal = (string) $text;
        return $this;
    }

    public function getPaypal()
    {
        return $this->_paypal;
    }
    
	public function setBank($text)
    {
        $this->_bank = (string) $text;
        return $this;
    }

    public function getBank()
    {
        return $this->_bank;
    }
    
	public function setCheque($text)
    {
        $this->_cheque = (string) $text;
        return $this;
    }

    public function getCheque()
    {
        return $this->_cheque;
    }
    
    public function setOthers($text)
    {
        $this->_others = (string) $text;
        return $this;
    }

    public function getOthers()
    {
        return $this->_others;
    }
    
	public function setStatus($text)
    {
        $this->_status = (string) $text;
        return $this;
    }

    public function getStatus()
    {
        return $this->_status;
    }
    
	public function setWinner($id)
    {
        $this->_winner = (string) $id;
        return $this;
    }

    public function getWinner()
    {
        return $this->_winner;
    }
    
	public function setCreation_time($text)
    {
        $this->_creation_time =  $text;
        return $this;
    }

    public function getCreation_time()
    {
        return $this->_creation_time;
    }
    
    /*** product_buy_bid ***/
	public function setFinal_price($final_price)
    {
        $this->_final_price = (int) $final_price;
        return $this;
    }

    public function getFinal_price()
    {
        return $this->_final_price;
    }

	public function setUsername($text)
    {
        $this->_username =  $text;
        return $this;
    }

    public function getUsername()
    {
        return $this->_username;
    }
}

